using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EnemyState :State
{
    protected Enemy enemyBase;
    protected StateMachine<EnemyState> stateMachine;
    protected string animBoolName;

    protected GameTimer stateTimer;
    protected bool triggerCalled;


    public EnemyState(Enemy enemyBase, StateMachine<EnemyState> stateMachine, string animBoolName)
    { 
        this.enemyBase = enemyBase;
        this.stateMachine = stateMachine;
        this.animBoolName = animBoolName;

        stateTimer = new GameTimer();
    }

    public virtual void Enter()
    {
        triggerCalled = false;
        enemyBase.anim.SetBool(animBoolName, true);
        
    }
    public virtual void Exit() 
    {
        enemyBase.anim.SetBool(animBoolName, false);
    }

    public virtual void Update()
    {
        stateTimer.Timer -= Time.deltaTime;
    }

    public virtual void AnimationFinishTrigger()
    {
        triggerCalled = true;
    }
}
